home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 January to June / Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64 / commodares #5-2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  393b  |  15 lines

  1. 0 rem--ahoy!--may issue--commodares #5--prog page 92
  2. 1 rem << prob 4-4 : random repetition
  3. 2 rem rvs on=chr$(18):rvs off=chr$(146)
  4. 3 rem - flag is true (-1) when previous a% equals previous b%
  5. 5 flag=0
  6. 10 a%=rnd(0)*10
  7. 20 b%=rnd(0)*10
  8. 30 if not flag then print chr$(146);
  9. 35 rem - lines 40 & 50 determine the next state of the flag
  10. 40 flag=0
  11. 50 if a%=b% then print chr$(18);:flag=-1
  12. 60 print a%;
  13. 70 a%=b%
  14. 80 goto 20
  15.